/**
 * output package name
 */
package com.kingdee.eas.custom.jiu.statement;

import java.awt.event.*;
import java.util.Date;

import org.apache.log4j.Logger;

import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.basedata.org.CtrlUnitInfo;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.framework.*;
import com.kingdee.eas.ma.base.client.BgCostCenterBaseF7;

/**
 * output class name
 */
public class BudgetStatisticsFilterUI extends AbstractBudgetStatisticsFilterUI
{
    private static final Logger logger = CoreUIObject.getLogger(BudgetStatisticsFilterUI.class);
    
    @Override
    public void onShow() throws Exception {
    	// TODO Auto-generated method stub
    	super.onShow();
    	
    	
    	
    }
    
    @Override
    public void onLoad() throws Exception {   	
    	super.onLoad();
    	kDComboBox4.setSelectedIndex(11);
    	
    	int da = Integer.parseInt(("" +new Date()).substring(("" +new Date()).length()-4));
    	kDSpinner1.setValue(da);		
    	
    	//拿到当前组织下的成本中心等
        CtrlUnitInfo  company= SysContext.getSysContext().getCurrentCtrlUnit();//获取当前管理单元CU ,比财务组织'成本中心更上一级     	
		String companyId = company.getId().toString(); //当前组织ID
		
		EntityViewInfo view = new EntityViewInfo(); 
		FilterInfo filter = new FilterInfo();
		filter.getFilterItems().add(new FilterItemInfo("cu.id", companyId));
		view.setFilter(filter);
		admin.setEntityViewInfo(view);
    	
		//添加Selector实现左树右表  
		CtrlUnitInfo CU = SysContext.getSysContext().getCurrentCtrlUnit();
		BgCostCenterBaseF7 orgView = new BgCostCenterBaseF7(this);  //拿到成本中心封装好的查询
			 		  
	    orgView.setRootUnitID(CU.getId().toString());
	    
        orgView.setMultiSelect(true);//多选
        orgView.setContainSealUp(true);	
		this.admin.setSelector(orgView);
    }
	/**
	 * 自定义用户查询UI
	 * 获取输入框中的值进行查询
	 */
	// 获取条件用户UI的文本框中的值放到filter中并返回
	public FilterInfo getFilterInfo() {

		FilterInfo filter = super.getFilterInfo();
		
	
		return filter;
	}
    
    /**
     * output class constructor
     */
    public BudgetStatisticsFilterUI() throws Exception
    {
        super();
    }

    /**
     * output storeFields method
     */
    public void storeFields()
    {
        super.storeFields();
    }

}